package UIComponents
{
	import MyComponent.MyButton;
	
	import fl.events.ComponentEvent;
	
	import flash.display.Sprite;
	
	public class BaseWinBg extends Sprite
	{
		public function BaseWinBg()
		{
			init();
		}
		
		private function init():void
		{
			(this.getChildByName("windowCloseBtn") as MyButton).addEventListener(ComponentEvent.BUTTON_DOWN,closeFun);
		}
		
		private function closeFun(e:ComponentEvent):void
		{
			this.dispatchEvent(new PanelEvent(PanelEvent.CLOSE,true));
		}
		
		public function controlCloseBtnVisable(visable:Boolean):void{
			this.getChildByName("windowCloseBtn").visible=visable;
		}
	}
}